<!-- Modal -->
<div class="modal fade " id="addBlockTradeModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">添加大宗交易</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form id="addBlockTradeFrom" class="form-horizontal">
                <div class="box-body">
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">成交编号</label>

                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="cjbh"  data-provide="typeahead">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">基金编码</label>

                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="combiId"  data-provide="typeahead">
                        </div>
                    </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary pull-right" onclick="blockTradeSave()">添加</button>
                </div>
                <!-- /.box-footer -->
            </form>
        </div>
    </div>
</div>
<script>
    function hsfundidModelInit() {
        $("#cjbh").val("");
        $("#combiId").val("");
    }
    function blockTradeSave() {
        var cjbh = $("#cjbh").val();
        var combiId = $("#combiId").val();
        if(undefined == cjbh || cjbh == "" ) {
            toastr['error']('成交编号不能为空', '提示');
            return;
        }
        if(combiId == "" || undefined == combiId) {
            toastr['error']('基金编号不能为空', '提示');
            return;
        }
        var data = {
            cjbh: cjbh,
            combiId: combiId
        };
        var url = "/operationsupplement/addhsfundid";
        postReq(url,data,function (result) {
            if(result.success){
                $('#addBlockTradeModel').modal('hide') ;
                hsfundidModelInit();
                hsfundidTableSearch();
                toastr['success']('添加成功', '提示');
            } else {
                toastr['error'](result.msg, '提示');
            }
        }) ;

    }

</script>
